import request from '@/utils/request'

// 查询供应商列表
export function listSupplier(query) {
    return request({
        url: '/system/supplierInfo/list',
        method: 'get',
        params: query
    })
}

// 查询供应商列表（不分页）
export function getSupplierList(query) {
  return request({
    url: '/system/supplierInfo/getlist',
    method: 'get',
    params: query
  })
}

// 查询供应商详细
export function getSupplier(postId) {
    return request({
        url: '/system/supplierInfo/' + postId,
        method: 'get'
    })
}

// 新增供应商
export function addSupplier(data) {
    return request({
        url: '/system/supplierInfo',
        method: 'post',
        data: data
    })
}

// 修改供应商
export function updateSupplier(data) {
    return request({
        url: '/system/supplierInfo',
        method: 'put',
        data: data
    })
}

// 删除供应商
export function delSupplier(postId) {
    return request({
        url: '/system/supplierInfo/' + postId,
        method: 'delete'
    })
}

// 禁用
export function stopSupplier(postId) {
    return request({
        url: '/system/supplierInfo/disable/' + postId,
        method: 'post',
    })
}
// 启用
export function startSupplier(postId) {
    return request({
        url: '/system/supplierInfo/enable/' + postId,
        method: 'post',
    })
}
// 导入

export function exportSupplier(data) {
    return request({
        url: '/system/supplierInfo/export',
        method: 'post',
        data: data
    })
}
// 查询接入信息
export function seeSupplier( postId) {
    return request({
        url: '/system/supplierInfo/getInfoBySupplierId/' + postId,
        method: 'post',
    })
}
// 完善供应商信息

export function perfetSupplier(data) {
    return request({
        url: '/system/supplierInfo/perfect',
        method: 'post',
        data: data
    })
}
// 重置密钥
export function keySupplier(postId) {
    return request({
        url: '/system/supplierInfo/resetKey/' + postId,
        method: 'post',
    })
}